import {Component, OnInit} from '@angular/core';
import {AppService} from './services/app.service';

/**
 * 装饰器
 */
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})

export class AppComponent {
  /**
   * 页面标题
   */
  pageTitle: string;

  /**
   * App模块构造器
   * @param {AppService} appService 注入appService服务
   */
  constructor(private appService: AppService) {
    appService.getPageTitle().subscribe(value => this.pageTitle = value);
  }
}
